package entity;

import java.net.PortUnreachableException;

/**
 * Created by Administrator on 2016/6/15.
 */
public class RecordEntity {
    private int ID;
    public enum RECORD_TYPE {
        CONTACT(1), URL(2), TEXT(3);
        private int typeValue;
        private String typeName;

        private RECORD_TYPE(int typeValue) {
            this.typeValue = typeValue;
            switch (typeValue) {
                case 1:
                    this.typeName = "联系人";
                    break;
                case 2:
                    this.typeName = "网址";
                    break;
                case 3:
                    this.typeName = "文本";
                    break;
            }
        }

        public static RECORD_TYPE parseFromValue(int typeValue) {
            switch (typeValue) {
                case 1:
                    return CONTACT;
                case 2:
                    return URL;
                case 3:
                    return TEXT;
                default:
                    return TEXT;
            }
        }

        public int getTypeValue() {
            return typeValue;
        }
    public String getTypeName() {
        return typeName;
    }
};

    public enum RECORD_FROM {
        MAKE(0),SCAN(1);
        private int value;
        private RECORD_FROM(int value){
            this.value = value;
        }

        public int getValue() {
            return value;
        }

        public static RECORD_FROM parseFromValue(int value){
            if(value == 0) return MAKE;
            else return SCAN;
        }
    }
    public RecordEntity(){}

    public RecordEntity(RECORD_TYPE record_type, RECORD_FROM record_from, Object recordContent, long recordTime) {
        this.record_type = record_type;
        this.record_from = record_from;
        this.recordContent = recordContent;
        this.recordTime =recordTime;
    }
    public RecordEntity(RECORD_TYPE recordType, Object recordContent, RECORD_FROM recordFrome) {
        this.record_type = recordType;
        this.recordContent = recordContent;
        this.record_from = recordFrome;
        this.recordTime = System.currentTimeMillis();
    }

    private RECORD_TYPE record_type;
    private Object recordContent;
    private RECORD_FROM record_from;
    private long recordTime;

    public RECORD_FROM getRecord_from() {
        return record_from;
    }

    public void setRecord_from(RECORD_FROM record_from) {
        this.record_from = record_from;
    }

    public RECORD_TYPE getRecord_type() {
        return record_type;
    }

    public void setRecord_type(RECORD_TYPE record_type) {
        this.record_type = record_type;
    }

    public Object getRecordContent() {
        return recordContent;
    }

    public void setRecordContent(Object recordContent) {
        this.recordContent = recordContent;
    }

    public long getRecordTime() {
        return recordTime;
    }

    public int getID() {
        return ID;
    }

    public void setID(int ID) {
        this.ID = ID;
    }

    public void setRecordTime(long recordTime) {
        this.recordTime = recordTime;

    }
}
